import { MidwayConfig } from '@midwayjs/core';

export default {
  // Web 框架配置
  egg: {
    port: process.env.PORT || 7001,
  },
  
  // 安全密钥
  keys: process.env.KEYS || 'midway_key',
  
  // TypeORM 数据库配置
  typeorm: {
    dataSource: {
      default: {
        type: process.env.DB_TYPE || 'mysql',
        host: process.env.DB_HOST || '127.0.0.1',
        port: Number(process.env.DB_PORT || 3306),
        username: process.env.DB_USER || 'root',
        password: process.env.DB_PASS || '123456',
        database: process.env.DB_NAME || 'repairs',
        synchronize: true,
        logging: false,
        entities: ['**/entities/*.entity{.ts,.js}']
      }
    }
  },
} as MidwayConfig;